package com.gzy.wbapplication.net;

import com.gzy.wbapplication.model.MyLog;
import com.gzy.wbapplication.model.Page;
import com.gzy.wbapplication.model.Result;
import com.gzy.wbapplication.model.User;
import com.gzy.wbapplication.net.core.XXModelCallback;
import com.gzy.wbapplication.net.core.XXURLUtils;

import java.util.HashMap;
import java.util.Map;

public class LogApi {

    public static void getLogList(String token,long page, long size,XXModelCallback<Result<Page<MyLog>>> callback) {

        Map<String, String> header = new HashMap<>();

        header.put("token",token);

        Map<String, String> para = new HashMap<>();

        para.put("page",page+"");
        para.put("size",size+"");

        XXURLUtils.shared.get(URLs.Log.mylogpage, header, para, callback);
    }


    public static void addLog(String token,String content,XXModelCallback<Result<MyLog>> callback) {

        Map<String, String> header = new HashMap<>();

        header.put("token",token);

        Map<String, String> para = new HashMap<>();

        para.put("content",content);

        XXURLUtils.shared.post(URLs.Log.addlog, header, para, callback);
    }

    public static void updateLog(String token,int id,String content,XXModelCallback<Result<MyLog>> callback) {

        Map<String, String> header = new HashMap<>();

        header.put("token",token);

        Map<String, String> para = new HashMap<>();

        para.put("content",content);

        XXURLUtils.shared.put(URLs.Log.updatelog + id, header, para, callback);
    }

    public static void delLog(String token,int id,XXModelCallback<Result<String>> callback) {

        Map<String, String> header = new HashMap<>();

        header.put("token",token);

        Map<String, String> para = new HashMap<>();


        XXURLUtils.shared.delete(URLs.Log.dellog + id, header, para, callback);
    }

}
